package com.example.ex5_springboot.mappers;

import com.example.ex5_springboot.pojo.AdminGetPerson;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminGetPersonMapper {
    @Select("select * from admin_getPerson")
    List<AdminGetPerson> getAllPerson();

    @Select("select * from admin_getPerson where user_id = #{id}")
    List<AdminGetPerson> getPersonByName(int id);

    @Insert("insert into admin_getperson(user_id,college,name,health,temperature,outside,time,work,remark) " +
            "values " +
            "(#{user_id},#{college},#{name},#{health},#{temperature},#{outside},now(),#{work},#{remark})")
    int insertNewRegister(int user_id,String college,String name,String health,double temperature,String outside,String work,String remark);


}
